<?php
/**
 * Description
 * User: duanwenjie
 * Date: 2019/5/16
 * Time: 10:49 AM
 */

namespace app\tasks\controller;
use app\common\YujisoController;
use app\index\service\TasksService;

class Purchaseplan extends YujisoController
{
    public $param;
    public function __construct()
    {
        parent::__construct();
        $temp = $this->request->param();
        if (isset($temp['s'])) unset($temp['s']);
        $this->param = $temp;
    }

    /**
     * 抓取进销存 upload_batch_skus、upload_batch_details、purchaseorders、purchaseorder_details 四张表数据同步到YUJISO
     * 每十分钟执行一次同步任务
     * 规则：抓取 warehouse_id = 7 && create_time = 最近一小时数据 （防止漏数据）
     * @author duanwenjie
     */
    public function syncNewErpPrToYujiso()
    {
        $param = $this->param;
        TasksService::syncNewErpPrToYujiso($param);
    }

    /**
     * 更新店铺销售库存分析报表数据
     * 每天凌晨三点更新
     * @author duanwenjie
     */
    public function updateShopSaleStockData()
    {
        TasksService::updateShopSaleStockData();
    }

    /**
     * 更新店仓库存管理库龄
     * 每天两点更新
     * @author duanwenjie
     */
    public function updateStockAge()
    {
        TasksService::updateStockAge();
    }

}